﻿<Window x:Class="SlaktDataReader.winLocation"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Område" Height="450" Width="700" DataContext="{Binding RelativeSource={RelativeSource self}}" Loaded="Window_Loaded"
        WindowStyle="ToolWindow" WindowStartupLocation="CenterScreen" ResizeMode="NoResize">
    <Grid Background="{StaticResource BG1}">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="130" />
            <ColumnDefinition Width="528*" />
            <ColumnDefinition Width="20" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="75" />
            <RowDefinition Height="50" />
            <RowDefinition Height="{Binding Path=ParentLocationHeight}" x:Name="rdParent" />
            <RowDefinition Height="50" />
            <RowDefinition Height="50" />
            <RowDefinition Height="50" />
            <RowDefinition Height="133*" />
        </Grid.RowDefinitions>
        <TextBlock Height="23" HorizontalAlignment="Right" Margin="0,0,10,10" Name="textBlock1" Text="Namn:" VerticalAlignment="Bottom" Style="{StaticResource StdLabels}" />
        <TextBlock Grid.Row="1" Height="23" HorizontalAlignment="Right" Margin="0,0,10,10" Name="textBlock2" Text="Typ:" VerticalAlignment="Bottom" Style="{StaticResource StdLabels}" />
        <TextBlock Grid.Row="2" Height="23" HorizontalAlignment="Right" Margin="0,0,10,10" Name="textBlock3" Text="Ligger i:" VerticalAlignment="Bottom" Style="{StaticResource StdLabels}" Visibility="{Binding Path=ParentVisible}" />
        <TextBlock Grid.Row="3" Height="23" HorizontalAlignment="Right" Margin="0,0,10,10" Name="textBlock4" Text="Områdeskod:" VerticalAlignment="Bottom" Style="{StaticResource StdLabels}"  />
        <TextBlock Grid.Row="4" Height="23" HorizontalAlignment="Right" Margin="0,0,10,10" Name="textBlock5" Text="Start:" VerticalAlignment="Bottom" Style="{StaticResource StdLabels}" />
        <TextBlock Grid.Row="5" Height="23" HorizontalAlignment="Right" Margin="0,0,10,10" Name="textBlock6" Text="Kommentar:" VerticalAlignment="Bottom" Style="{StaticResource StdLabels}" />

        <TextBox Grid.Row="0" Grid.Column="1" VerticalAlignment="Bottom" Margin="10,0,10,10" FontSize="16" Text="{Binding Path=loc.LocationName, Mode=TwoWay}" />
        
        <TextBox Grid.Row="5" Grid.Column="1" Grid.RowSpan="2"  VerticalAlignment="Stretch" Margin="10,15,10,45" FontSize="16" Text="{Binding Path=loc.LocationNotes, Mode=TwoWay}" AcceptsReturn="True" AcceptsTab="True" />
        <ComboBox Grid.Row="2" Grid.Column="1" VerticalAlignment="Bottom" Margin="10,0,10,10" Name="cbParents" 
                  Visibility="{Binding Path=ParentVisible}" ItemsSource="{Binding Path=Counties}" SelectedValuePath="LocationID" 
                  SelectedValue="{Binding Path=loc.ParentID, Mode=TwoWay}" DisplayMemberPath="LocationName"/>
        
        <Grid Grid.Row="1" Grid.Column="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition />
                <ColumnDefinition />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            
            <RadioButton Grid.Column="0" Content="Län" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" FontSize="16" IsChecked="{Binding Path=IsLevel1}" />
            <RadioButton Grid.Column="1" Content="Socken" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" FontSize="16" IsChecked="{Binding Path=IsLevel2}" />
            <RadioButton Grid.Column="2" Content="Härad" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" FontSize="16" IsChecked="{Binding Path=IsLevel3}" />
            <RadioButton Grid.Column="3" Content="Annat" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" FontSize="16" IsChecked="{Binding Path=IsLevel4}" />
            
        </Grid>
        
        <Grid Grid.Column="1" Grid.Row="3">
            <Grid.ColumnDefinitions >
                <ColumnDefinition />
                <ColumnDefinition />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <TextBox Grid.Column="0" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" Margin="10,0,10,10"  FontSize="16" Text="{Binding Path=loc.LocationCode, Mode=TwoWay}" />
            <TextBlock Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,9,13" Text="Alternativ kod:" Style="{StaticResource StdLabels}" />
            <TextBox Grid.Column="2" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" Margin="10,0,10,10"  FontSize="16" Text="{Binding Path=loc.SecondaryCode, Mode=TwoWay}" />
        </Grid>

        <Grid Grid.Column="1" Grid.Row="4">
            <Grid.ColumnDefinitions >
                <ColumnDefinition />
                <ColumnDefinition />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <TextBox Grid.Column="0" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" Margin="10,0,10,10"  FontSize="16" Text="{Binding Path=loc.FirstDate, Mode=TwoWay}" />
            <TextBlock Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,9,13" Text="Slut:" Style="{StaticResource StdLabels}" />
            <TextBox Grid.Column="2" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" Margin="10,0,10,10"  FontSize="16" Text="{Binding Path=loc.LastDate, Mode=TwoWay}" />
        </Grid>

        <Button Content="Ok" Grid.Column="1" Grid.Row="6" Height="23" HorizontalAlignment="Right" Margin="0,0,10,10" Name="bOk" VerticalAlignment="Bottom" Width="75" Click="bOk_Click"/>
    </Grid>
</Window>
